package com.bestdreamer.threadbasic;

public class MyThreadBasic extends Thread {

    private int count = 5;

    public MyThreadBasic(){
        super();
    }
    public MyThreadBasic(String name){
        super(name);
    }

    @Override
    public void run() {
        super.run();
        count --;
        System.out.println("由"+ currentThread().getName() + "计算，count="+ count);
    }

    public static void main(String[] args) {
        MyThreadBasic myThreadBasic = new MyThreadBasic();
        Thread a = new Thread(myThreadBasic,"A");
        Thread b = new Thread(myThreadBasic,"B");
//        MyThreadBasic b = new MyThreadBasic("B");
        Thread c = new Thread(myThreadBasic,"C");
        Thread d = new Thread(myThreadBasic,"D");
        Thread e = new Thread(myThreadBasic,"E");
        a.start();
        b.start();
        c.start();
        d.start();
        e.start();
    }
}
